﻿using System.Security;

namespace orleans_demo.Filter
{
    /// <summary>
    /// 鉴权拦截器 模拟
    /// </summary>
    public class AuthInterceptor : IIncomingGrainCallFilter
    {
        public async Task Invoke(IIncomingGrainCallContext context)
        {
            var authHeader = RequestContext.Get("Authorization");
            //if (!ValidateToken(authHeader))
            //    throw new SecurityException("未授权访问");
            Console.WriteLine("authInter");

            await context.Invoke();
        }
    }
}
